import React from 'react'
import { NavBar } from 'antd-mobile'
import { withRouter } from 'react-router-dom'

const NavHeader = props => {
  // console.log(props)
  return (
    <NavBar
      mode="light"
      icon={<i className="iconfont icon-back"></i>}
      onLeftClick={() => props.history.push('/')}
    >
      {props.children}
    </NavBar>
  )
}

export default withRouter(NavHeader)
